<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
<h:head>
    <title>Gift return transport</title>
</h:head>

<h:body onload="#{GiftManaged.searchById()}">
<h:form>
	<p:panelGrid columns="2">
			<h:outputLabel>Name</h:outputLabel>
			<h:outputText value="#{GiftManaged.rDTO.name}" />
			<h:outputLabel>Available Places</h:outputLabel>
			<h:outputText value="#{GiftManaged.rDTO.availablePlaces}" />
			<h:outputLabel>Type</h:outputLabel>
			<h:outputText value="#{GiftManaged.rDTO.type}" />
			<h:outputLabel>Arrival Time</h:outputLabel>
			<h:outputText value="#{GiftManaged.rDTO.arrivalTime}">
				<f:convertDateTime type="time" timeStyle="short" timeZone="Europe/Paris"/>
		    </h:outputText>
			<h:outputLabel>Departure Time</h:outputLabel>
			<h:outputText value="#{GiftManaged.rDTO.departureTime}">
				<f:convertDateTime type="time" timeStyle="short" timeZone="Europe/Paris"/>
		    </h:outputText>
			<h:outputLabel>Arrival Date</h:outputLabel>
			<h:outputText value="#{GiftManaged.rDTO.arrivalDate}">
				<f:convertDateTime type="date" pattern="dd-MM-yyyy" timeZone="Europe/Paris"/>
		    </h:outputText>
			<h:outputLabel>Departure Date</h:outputLabel>
			<h:outputText value="#{GiftManaged.rDTO.departureDate}">
				<f:convertDateTime type="date" pattern="dd-MM-yyyy" timeZone="Europe/Paris"/>
		    </h:outputText>
			<h:outputLabel>Arrival Place</h:outputLabel>
			<h:outputText value="#{GiftManaged.rDTO.arrivalPlace}" />
			<h:outputLabel>Departure Place</h:outputLabel>
			<h:outputText value="#{GiftManaged.rDTO.departurePlace}" />
			<h:outputLabel>Company</h:outputLabel>
			<h:outputText value="#{GiftManaged.rDTO.company}" />
			<h:outputLabel>Price</h:outputLabel>
			<h:outputText value="#{GiftManaged.rDTO.price}" />
		</p:panelGrid>
	<p:commandButton id="return" value="Confirm" action="#{GiftManaged.giftReturn()}"  ajax="false" />
	<p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" /> 
	</h:form>
</h:body>
</html>